package com.example.demo.index;

import com.agui.demo.core.entity.Student;
import com.example.demo.service.DemoService;
import com.rs.cloud.common.core.utils.WebKeys;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright(c)2015-2025, xxxxxxxxx有限公司
 * All rights reserved.
 * <p>
 * 项目名称:demo
 * 文件名称:IndexContronller
 *
 * @author ygp
 * @create 2023-7-6 11:15
 */
@RestController
@Slf4j
public class IndexController {


    @Autowired
    private DemoService demoService;


    /**
     * 首页测试方法
     *
     * @return
     */
    @RequestMapping("/")
    public String index() {
        log.info("-----ok-----");
        return "ok";
    }


    /**
     * 变量测试方法
     *
     * @return
     */
    @RequestMapping("/test")
    public String Demo() {
        String str = "zhonghua";
        String res = WebKeys.ACCT_CODE;
        log.info("-----test-----" + res);
        return res;
    }


    /**
     * 获取学生信息方法
     *
     * @return
     */
    @RequestMapping("/student")
    public String getStudent() {

        String name = "yang";
        Student st = demoService.getStu(name);

        String res = st.toString();
        return res;

    }


}
